#ifndef PORTprimitivesH
 #define PORTprimitivesH

 

 #define PinMod0     0
 #define PinMod1     1
 #define PinMod2     2
 #define PinMod3     3
 #define PullUp      0
 #define PullFl      2
 #define PullDn      3
 #define In          0
 #define Out         1
 #define On          0
 #define Off         1



/****************************************************************************************************/
/*                                        P O R T 0                                                 */
/*                    P I N S E L E C T    B I T'S    D E F I N E                                   */
/****************************************************************************************************/
/*PORT0 pin0*/
 #define P0_0_G        ( PinMod0<<0 )   //General purpose digital in/out pin
 #define P0_0_RD1      ( PinMod1<<0 )   //CAN1 receiver in
 #define P0_0_TXD3     ( PinMod2<<0 )   //TxD for UART3
 #define P0_0_SDA1     ( PinMod3<<0 )   //I2C1 SDA (not open drain)
/*PORT0 pin1*/
 #define P0_1_G        ( PinMod0<<2 )   //General purpose digital in/out pin
 #define P0_1_TD1      ( PinMod1<<2 )   //CAN1 Transmitter out
 #define P0_1_RXD3     ( PinMod2<<2 )   //RxD for UART3
 #define P0_1_SCL1     ( PinMod3<<2 )   //I2C1 SCL (not open drain)
/*PORT0 pin2*/
 #define P0_2_G        ( PinMod0<<4 )   //General purpose digital in/out pin
 #define P0_2_TXD0     ( PinMod1<<4 )   //TxD for UART0
/*PORT0 pin3*/
 #define P0_3_G        ( PinMod0<<6 )   //General purpose digital in/out pin
 #define P0_3_RXD0     ( PinMod1<<6 )   //RxD for UART0
/*PORT0 pin4*/
 #define P0_4_G        ( PinMod0<<8 )   //General purpose digital in/out pin
 #define P0_4_RxCLK    ( PinMod1<<8 )   //I2S_RX_CLK
 #define P0_4_RD2      ( PinMod2<<8 )   //CAN2 receiver in
 #define P0_4_CAP2_0   ( PinMod3<<8 )   //Capture in for TIMER2 channel0
/*PORT0 pin5*/
 #define P0_5_G        ( PinMod0<<10)   //General purpose digital in/out pin
 #define P0_5_RxWS     ( PinMod1<<10)   //I2S_RX_WS 
 #define P0_5_TD2      ( PinMod2<<10)   //CAN2 Transmitter out
 #define P0_5_CAP2_1   ( PinMod3<<10)   //Capture in for TIMER2 channel1
/*PORT0 pin6*/
 #define P0_6_G        ( PinMod0<<12)   //General purpose digital in/out pin
 #define P0_6_RxSDA    ( PinMod1<<12)   //I2S_RX_SDA
 #define P0_6_SSEL1    ( PinMod2<<12)   //Slave Select for SSP1
 #define P0_6_MAT2_0   ( PinMod3<<12)   //Match out for TIMER2 channel0
/*PORT0 pin7*/
 #define P0_7_G        ( PinMod0<<14)   //General purpose digital in/out pin
 #define P0_7_TxCLK    ( PinMod1<<14)   //I2S_TX_CLK
 #define P0_7_SCK1     ( PinMod2<<14)   //SCK for SSP1
 #define P0_7_MAT2_1   ( PinMod3<<14)   //Match out for TIMER2 channel1
/*PORT0 pin8*/
 #define P0_8_G        ( PinMod0<<16)   //General purpose digital in/out pin
 #define P0_8_TxWS     ( PinMod1<<16)   //I2S_TX_WS 
 #define P0_8_MISO1    ( PinMod2<<16)   //MISO for SSP1
 #define P0_8_MAT2_2   ( PinMod3<<16)   //Match out for TIMER2 channel2
/*PORT0 pin9*/
 #define P0_9_G        ( PinMod0<<18)   //General purpose digital in/out pin
 #define P0_9_TxSDA    ( PinMod1<<18)   //I2S_TX_SDA
 #define P0_9_MOSI1    ( PinMod2<<18)   //MOSI for SSP1
 #define P0_9_MAT2_3   ( PinMod3<<18)   //Match out for TIMER2 channel3
/*PORT0 pin10*/
 #define P0_10_G       ( PinMod0<<20)   //General purpose digital in/out pin
 #define P0_10_TXD2    ( PinMod1<<20)   //TxD for UART2
 #define P0_10_SDA2    ( PinMod2<<20)   //I2C2 SDA (not open drain)
 #define P0_10_MAT3_0  ( PinMod3<<20)   //Match out for TIMER3 channel0
/*PORT0 pin11*/
 #define P0_11_G       ( PinMod0<<22)   //General purpose digital in/out pin
 #define P0_11_RXD2    ( PinMod1<<22)   //RxD for UART2
 #define P0_11_SCL2    ( PinMod2<<22)   //I2C2 SCL (not open drain)
 #define P0_11_MAT3_1  ( PinMod3<<22)   //Match out for TIMER3 channel1
/*PORT0 pin12*/
 #define P0_12_G       ( PinMod0<<24)   //General purpose digital in/out pin
 #define P0_12_MISO1   ( PinMod1<<24)   //MISO for SSP1
 #define P0_12_AD0_6   ( PinMod2<<24)   //ADC0 in6
/*PORT0 pin13*/
 #define P0_13_G       ( PinMod0<<26)   //General purpose digital in/out pin
 #define P0_13_UUL2    ( PinMod1<<26)   //USB_UP_LED2  
 #define P0_13_MOSI1   ( PinMod2<<26)   //MOSI for SSP1
 #define P0_13_AD0_7   ( PinMod3<<26)   //ADC0 in7
/*PORT0 pin14*/
 #define P0_14_G       ( PinMod0<<28)   //General purpose digital in/out pin
 #define P0_14_UC2     ( PinMod1<<28)   //USB_CONNECT2 
 #define P0_14_SSEL1   ( PinMod2<<28)   //SSEL for SSP1
/*PORT0 pin15*/
 #define P0_15_G       ( PinMod0<<30)   //General purpose digital in/out pin
 #define P0_15_TXD1    ( PinMod1<<30)   //TxD for UART1
 #define P0_15_SCK0    ( PinMod2<<30)   //SCK for SSP0
 #define P0_15_SCK     ( PinMod3<<30)   //SCK for SPI
/*PORT0 pin16*/
 #define P0_16_G       ( PinMod0<<0 )   //General purpose digital in/out pin
 #define P0_16_RXD1    ( PinMod1<<0 )   //RXD for UART1
 #define P0_16_SSEL0   ( PinMod2<<0 )   //SSEL for SSP0
 #define P0_16_SSEL    ( PinMod3<<0 )   //SSEL for SPI
/*PORT0 pin17*/
 #define P0_17_G       ( PinMod0<<2 )   //General purpose digital in/out pin
 #define P0_17_CTS1    ( PinMod1<<2 )   //CTS for UART1
 #define P0_17_MISO0   ( PinMod2<<2 )   //MISO for SSP0
 #define P0_17_MISO    ( PinMod3<<2 )   //MISO for SPI
/*PORT0 pin18*/
 #define P0_18_G       ( PinMod0<<4 )   //General purpose digital in/out pin
 #define P0_18_DCD1    ( PinMod1<<4 )   //DCD for UART1
 #define P0_18_MOSI0   ( PinMod2<<4 )   //MOSI for SSP0
 #define P0_18_MOSI    ( PinMod3<<4 )   //MOSI for SPI
/*PORT0 pin19*/
 #define P0_19_G       ( PinMod0<<6 )   //General purpose digital in/out pin
 #define P0_19_DSR1    ( PinMod1<<6 )   //DSR for UART1
 #define P0_19_MCCLK   ( PinMod2<<6 )   //SD/MMC CLK
 #define P0_19_SDA1    ( PinMod3<<6 )   //I2C1 SDA (not open drain)
/*PORT0 pin20*/
 #define P0_20_G       ( PinMod0<<8 )   //General purpose digital in/out pin
 #define P0_20_DTR1    ( PinMod1<<8 )   //DTR for UART1
 #define P0_20_MCCMD   ( PinMod2<<8 )   //SD/MMC Command line
 #define P0_20_SCL1    ( PinMod3<<8 )   //I2C1 SCL (not open drain)
/*PORT0 pin21*/
 #define P0_21_G       ( PinMod0<<10)   //General purpose digital in/out pin
 #define P0_21_RI1     ( PinMod1<<10)   //RI for UART1
 #define P0_21_MCPWR   ( PinMod2<<10)   //SD/MMC Power enable
 #define P0_21_RD1     ( PinMod3<<10)   //CAN1 Reciever in
/*PORT0 pin22*/
 #define P0_22_G       ( PinMod0<<12)   //General purpose digital in/out pin
 #define P0_22_RTS1    ( PinMod1<<12)   //RTS for UART1
 #define P0_22_MCD0    ( PinMod2<<12)   //SD/MMC Data0
 #define P0_22_TD1     ( PinMod3<<12)   //CAN1 Transmitter out
/*PORT0 pin23*/
 #define P0_23_G       ( PinMod0<<14)   //General purpose digital in/out pin
 #define P0_23_AD0_0   ( PinMod1<<14)   //ADC0 in0
 #define P0_23_RxCLK   ( PinMod2<<14)   //I2S_RX_CLK
 #define P0_23_CAP3_0  ( PinMod3<<14)   //Capture in for TIMER3 channel0
/*PORT0 pin24*/
 #define P0_24_G       ( PinMod0<<16)   //General purpose digital in/out pin
 #define P0_24_AD0_1   ( PinMod1<<16)   //ADC0 in1
 #define P0_24_RxWS    ( PinMod2<<16)   //I2S_RX_WS
 #define P0_24_CAP3_1  ( PinMod3<<16)   //Capture in for TIMER3 channel1
/*PORT0 pin25*/
 #define P0_25_G       ( PinMod0<<18)   //General purpose digital in/out pin
 #define P0_25_AD0_2   ( PinMod1<<18)   //ADC0 in2
 #define P0_25_RxSDA   ( PinMod2<<18)   //I2S_RX_SDA
 #define P0_25_TXD3    ( PinMod3<<18)   //TxD for UART3
/*PORT0 pin26*/
 #define P0_26_G       ( PinMod0<<20)   //General purpose digital in/out pin
 #define P0_26_AD0_3   ( PinMod1<<20)   //ADC0 in3
 #define P0_26_AOUT    ( PinMod2<<20)   //DAC out
 #define P0_26_RXD3    ( PinMod3<<20)   //RxD for UART3
/*PORT0 pin27*/
 #define P0_27_G       ( PinMod0<<22)   //General purpose digital in/out pin
 #define P0_27_SDA0    ( PinMod1<<22)   //I2C0 SDA (open drain)
/*PORT0 pin28*/
 #define P0_28_G       ( PinMod0<<24)   //General purpose digital in/out pin
 #define P0_28_SCL0    ( PinMod1<<24)   //I2C0 SCL (open drain)
/*PORT0 pin29*/
 #define P0_29_G       ( PinMod0<<26)   //General purpose digital in/out pin
 #define P0_29_UD1     ( PinMod1<<26)   //USB1_D+ line 
/*PORT0 pin30*/
 #define P0_30_G       ( PinMod0<<28)   //General purpose digital in/out pin
 #define P0_30_UD1_    ( PinMod1<<28)   //USB1_D- line 
/*PORT0 pin31*/
 #define P0_31_G       ( PinMod0<<30)   //General purpose digital in/out pin
 #define P0_31_UD2     ( PinMod1<<30)   //USB2_D+ line
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/


/****************************************************************************************************/
/*                                        P O R T 1                                                 */
/*                    P I N S E L E C T    B I T'S    D E F I N E                                   */
/****************************************************************************************************/
/*PORT1 pin0*/
 #define P1_0_G        ( PinMod0<<0 )   //General purpose digital in/out pin
 #define P1_0_ETXD0    ( PinMod1<<0 )   //ENET_TXD0
/*PORT1 pin1*/
 #define P1_1_G        ( PinMod0<<2 )   //General purpose digital in/out pin
 #define P1_1_ETXD1    ( PinMod1<<2 )   //ENET_TXD1
/*PORT1 pin4*/
 #define P1_4_G        ( PinMod0<<8 )   //General purpose digital in/out pin
 #define P1_4_ETXEN    ( PinMod1<<8 )   //ENET_TX_EN
/*PORT1 pin8*/
 #define P1_8_G        ( PinMod0<<16)   //General purpose digital in/out pin
 #define P1_8_ECRS     ( PinMod1<<16)   //ENET_CRS
/*PORT1 pin9*/
 #define P1_9_G        ( PinMod0<<18)   //General purpose digital in/out pin
 #define P1_9_ERXD0    ( PinMod1<<18)   //ENET_RXD0
/*PORT1 pin10*/
 #define P1_10_G       ( PinMod0<<20)   //General purpose digital in/out pin
 #define P1_10_ERXD1   ( PinMod1<<20)   //ENET_RXD1
/*PORT1 pin14*/
 #define P1_14_G       ( PinMod0<<28)   //General purpose digital in/out pin
 #define P1_14_ERXER   ( PinMod1<<28)   //ENET_RX_ER
/*PORT1 pin15*/
 #define P1_15_G       ( PinMod0<<30)   //General purpose digital in/out pin
 #define P1_15_ERFCLK  ( PinMod1<<30)   //ENET_REF_CLK / ENET_RX_CLK
/*PORT1 pin16*/
 #define P1_16_G       ( PinMod0<<0 )   //General purpose digital in/out pin
 #define P1_16_EMDC    ( PinMod1<<0 )   //ENET_MDC
/*PORT1 pin17*/
 #define P1_17_G       ( PinMod0<<2 )   //General purpose digital in/out pin
 #define P1_17_EMDIO   ( PinMod1<<2 )   //ENET_MDIO
/*PORT1 pin18*/
 #define P1_18_G       ( PinMod0<<4 )   //General purpose digital in/out pin
 #define P1_18_UUL1    ( PinMod1<<4 )   //USB_UP_LED1
 #define P1_18_PWM1_1  ( PinMod2<<4 )   //PWM1 channel1 out
 #define P1_18_CAP1_0  ( PinMod3<<4 )   //Capture in for TIMER1 channel0
/*PORT1 pin19*/
 #define P1_19_G       ( PinMod0<<6 )   //General purpose digital in/out pin
 #define P1_19_CAP1_1  ( PinMod1<<6 )   //Capture in for TIMER1 channel1
/*PORT1 pin20*/
 #define P1_20_G       ( PinMod0<<8 )   //General purpose digital in/out pin
 #define P1_20_PWM1_2  ( PinMod1<<8 )   //PWM1 channel2 out
 #define P1_20_SCK0    ( PinMod2<<8 )   //SCK for SSP0
/*PORT1 pin21*/
 #define P1_21_G       ( PinMod0<<10)   //General purpose digital in/out pin
 #define P1_21_PWM1_3  ( PinMod1<<10)   //PWM1 channel3 out
 #define P1_21_SSEL0   ( PinMod2<<10)   //SSEL for SSP0
/*PORT1 pin22*/
 #define P1_22_G       ( PinMod0<<12)   //General purpose digital in/out pin
 #define P1_22_MAT1_0  ( PinMod1<<12)   //Match out for TIMER1 channel0
/*PORT1 pin23*/
 #define P1_23_G       ( PinMod0<<14)   //General purpose digital in/out pin
 #define P1_23_PWM1_4  ( PinMod1<<14)   //PWM1 channel4 out
 #define P1_23_MISO0   ( PinMod2<<14)   //MISO for SSP0
/*PORT1 pin24*/
 #define P1_24_G       ( PinMod0<<16)   //General purpose digital in/out pin
 #define P1_24_PWM1_5  ( PinMod1<<16)   //PWM1 channel5 out
 #define P1_24_MOSI0   ( PinMod2<<16)   //MOSI for SSP0
/*PORT1 pin25*/
 #define P1_25_G       ( PinMod0<<18)   //General purpose digital in/out pin
 #define P1_25_MAT1_1  ( PinMod1<<18)   //Match out for TIMER1 channel1
/*PORT1 pin26*/
 #define P1_26_G       ( PinMod0<<20)   //General purpose digital in/out pin
 #define P1_26_PWM1_6  ( PinMod1<<20)   //PWM1 channel6 out
 #define P1_26_CAP0_0  ( PinMod2<<20)   //Capture in for TIMER0 channel0
/*PORT1 pin27*/
 #define P1_27_G       ( PinMod0<<22)   //General purpose digital in/out pin
 #define P1_27_CAP0_1  ( PinMod1<<22)   //Capture in for TIMER0 channel1
/*PORT1 pin28*/
 #define P1_28_G       ( PinMod0<<24)   //General purpose digital in/out pin
 #define P1_28_PCAP1_0 ( PinMod1<<24)   //Capture in for PWM1 channel0
 #define P1_28_MAT0_0  ( PinMod2<<24)   //Match out for TIMER0 channel0
/*PORT1 pin29*/
 #define P1_29_G       ( PinMod0<<26)   //General purpose digital in/out pin
 #define P1_29_PCAP1_1 ( PinMod1<<26)   //Capture in for PWM1 channel1
 #define P1_29_MAT0_1  ( PinMod2<<26)   //Match out for TIMER0 channel1
/*PORT1 pin30*/
 #define P1_30_G       ( PinMod0<<28)   //General purpose digital in/out pin
 #define P1_30_Vbus    ( PinMod1<<28)   //Vbus monitor for USB
 #define P1_30_AD0_4   ( PinMod2<<28)   //ADC0 in4
/*PORT1 pin31*/
 #define P1_31_G       ( PinMod0<<30)   //General purpose digital in/out pin
 #define P1_31_SCK1    ( PinMod1<<30)   //SCK for SSP1
 #define P1_31_AD0_5   ( PinMod2<<30)   //ADC0 in5
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/


/****************************************************************************************************/
/*                                        P O R T 2                                                 */
/*                    P I N S E L E C T    B I T'S    D E F I N E                                   */
/****************************************************************************************************/
/*PORT2 pin0*/
 #define P2_0_G        ( PinMod0<<0 )   //General purpose digital in/out pin
 #define P2_0_PWM1_1   ( PinMod1<<0 )   //PWM1 channel1 out
 #define P2_0_TXD1     ( PinMod2<<0 )   //TxD for UART1
 #define P2_0_TRCLK    ( PinMod3<<0 )   //TRACECLK
/*PORT2 pin1*/
 #define P2_1_G        ( PinMod0<<2 )   //General purpose digital in/out pin
 #define P2_1_PWM1_2   ( PinMod1<<2 )   //PWM1 channel2 out
 #define P2_1_RXD1     ( PinMod2<<2 )   //RxD for UART1
 #define P2_1_PST0     ( PinMod3<<2 )   //PIPESTAT0
/*PORT2 pin2*/
 #define P2_2_G        ( PinMod0<<4 )   //General purpose digital in/out pin
 #define P2_2_PWM1_3   ( PinMod1<<4 )   //PWM1 channel3 out
 #define P2_2_CTS1     ( PinMod2<<4 )   //CTS for UART1
 #define P2_2_PST1     ( PinMod3<<4 )   //PIPESTAT1
/*PORT2 pin3*/
 #define P2_3_G        ( PinMod0<<6 )   //General purpose digital in/out pin
 #define P2_3_PWM1_4   ( PinMod1<<6 )   //PWM1 channel4 out
 #define P2_3_DCD1     ( PinMod2<<6 )   //DCD for UART1
 #define P2_3_PST2     ( PinMod3<<6 )   //PIPESTAT2
/*PORT2 pin4*/
 #define P2_4_G        ( PinMod0<<8 )   //General purpose digital in/out pin
 #define P2_4_PWM1_5   ( PinMod1<<8 )   //PWM1 channel5 out
 #define P2_4_DSR1     ( PinMod2<<8 )   //DSR for UART1
 #define P2_4_TSYNC    ( PinMod3<<8 )   //TRACESYNC
/*PORT2 pin5*/
 #define P2_5_G        ( PinMod0<<10)   //General purpose digital in/out pin
 #define P2_5_PWM1_6   ( PinMod1<<10)   //PWM1 channel6 out
 #define P2_5_DTR1     ( PinMod2<<10)   //DTR for UART1
 #define P2_5_TPCT0    ( PinMod3<<10)   //TRACEPKT0
/*PORT2 pin6*/
 #define P2_6_G        ( PinMod0<<12)   //General purpose digital in/out pin
 #define P2_6_PCAP1_0  ( PinMod1<<12)   //Capture in for PWM1 channel0
 #define P2_6_RI1      ( PinMod2<<12)   //RI for UART1
 #define P2_6_TPCT1    ( PinMod3<<12)   //TRACEPKT1
/*PORT2 pin7*/
 #define P2_7_G        ( PinMod0<<14)   //General purpose digital in/out pin
 #define P2_7_RD2      ( PinMod1<<14)   //CAN2 Reciever in
 #define P2_7_RTS1     ( PinMod2<<14)   //RTS for UART1
 #define P2_7_TPCT2    ( PinMod3<<14)   //TRACEPKT2
/*PORT2 pin8*/
 #define P2_8_G        ( PinMod0<<16)   //General purpose digital in/out pin
 #define P2_8_TD2      ( PinMod1<<16)   //CAN2 Transmitter out
 #define P2_8_TXD2     ( PinMod2<<16)   //TxD for UART2
 #define P2_8_TPCT2    ( PinMod3<<16)   //TRACEPKT3
/*PORT2 pin9*/
 #define P2_9_G        ( PinMod0<<18)   //General purpose digital in/out pin
 #define P2_9_UCON1    ( PinMod1<<18)   //USB_CONNECT1
 #define P2_9_RXD2     ( PinMod2<<18)   //RxD for UART2
 #define P2_9_ETI0     ( PinMod3<<18)   //EXTIN0
/*PORT2 pin10*/
 #define P2_10_G       ( PinMod0<<20)   //General purpose digital in/out pin
 #define P2_10_EINT0   ( PinMod1<<20)   //EINT0
/*PORT2 pin11*/
 #define P2_11_G       ( PinMod0<<22)   //General purpose digital in/out pin
 #define P2_11_EINT1   ( PinMod1<<22)   //EINT1
 #define P2_11_MCD1    ( PinMod2<<22)   //MCIDAT1
 #define P2_11_TxCLK   ( PinMod3<<22)   //I2STX_CLK
/*PORT2 pin12*/
 #define P2_12_G       ( PinMod0<<24)   //General purpose digital in/out pin
 #define P2_12_EINT2   ( PinMod1<<24)   //EINT2
 #define P2_12_MCD2    ( PinMod2<<24)   //MCIDAT2
 #define P2_11_TxWS    ( PinMod3<<24)   //I2STX_WS
/*PORT2 pin13*/
 #define P2_13_G       ( PinMod0<<26)   //General purpose digital in/out pin
 #define P2_13_EINT3   ( PinMod1<<26)   //EINT3 
 #define P2_13_MCD3    ( PinMod2<<26)   //MCIDAT3
 #define P2_13_TxSDA   ( PinMod3<<26)   //I2STX_SDA
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/


/****************************************************************************************************/
/*                                        P O R T 3                                                 */
/*                    P I N S E L E C T    B I T'S    D E F I N E                                   */
/****************************************************************************************************/
/*PORT3 pin3*/
 #define P3_3_G        ( PinMod0<<6 )   //General purpose digital in/out pin
 #define P3_3_D0       ( PinMod1<<6 )   //External memory data line 0
/*PORT3 pin4*/
 #define P3_4_G        ( PinMod0<<8 )   //General purpose digital in/out pin
 #define P3_4_D1       ( PinMod1<<8 )   //External memory data line 1
/*PORT3 pin5*/
 #define P3_5_G        ( PinMod0<<10)   //General purpose digital in/out pin
 #define P3_5_D2       ( PinMod1<<10)   //External memory data line 2
/*PORT3 pin6*/
 #define P3_6_G        ( PinMod0<<12)   //General purpose digital in/out pin
 #define P3_6_D3       ( PinMod1<<12)   //External memory data line 3
/*PORT3 pin7*/
 #define P3_7_G        ( PinMod0<<14)   //General purpose digital in/out pin
 #define P3_7_D4       ( PinMod1<<14)   //External memory data line 4
/*PORT3 pin8*/
 #define P3_8_G        ( PinMod0<<16)   //General purpose digital in/out pin
 #define P3_8_D5       ( PinMod1<<16)   //External memory data line 5
/*PORT3 pin9*/
 #define P3_9_G        ( PinMod0<<18)   //General purpose digital in/out pin
 #define P3_9_D6       ( PinMod1<<18)   //External memory data line 6
/*PORT3 pin10*/
 #define P3_10_G       ( PinMod0<<20)   //General purpose digital in/out pin
 #define P3_10_D7      ( PinMod1<<20)   //External memory data line 7
/*PORT3 pin23*/
 #define P3_23_G       ( PinMod0<<14)   //General purpose digital in/out pin
 #define P3_23_CAP0_0  ( PinMod1<<14)   //Capture in for TIMER0 channel0
 #define P3_23_PCAP1_0 ( PinMod2<<14)   //Capture in for PWM1 channel0
/*PORT3 pin24*/
 #define P3_24_G       ( PinMod0<<16)   //General purpose digital in/out pin
 #define P3_24_CAP0_1  ( PinMod1<<16)   //Capture in for TIMER0 channel1
 #define P3_24_PWM1_1  ( PinMod2<<16)   //PWM1 channel1 out
/*PORT3 pin25*/
 #define P3_25_G       ( PinMod0<<18)   //General purpose digital in/out pin
 #define P3_25_MAT0_0  ( PinMod1<<18)   //Match out for TIMER0 channel0
 #define P3_25_PWM1_2  ( PinMod2<<18)   //PWM1 channel2 out
/*PORT3 pin26*/
 #define P3_26_G       ( PinMod0<<20)   //General purpose digital in/out pin
 #define P3_26_MAT0_1  ( PinMod1<<20)   //Match out for TIMER0 channel1
 #define P3_26_PWM1_3  ( PinMod2<<20)   //PWM1 channel3 out
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/


/****************************************************************************************************/
/*                                        P O R T 4                                                 */
/*                    P I N S E L E C T    B I T'S    D E F I N E                                   */
/****************************************************************************************************/
/*PORT4 pin0*/
 #define P4_0_G        ( PinMod0<<0 )   //General purpose digital in/out pin
 #define P4_0_A0       ( PinMod1<<0 )   //External memory address line 0
/*PORT4 pin1*/
 #define P4_1_G        ( PinMod0<<2 )   //General purpose digital in/out pin
 #define P4_1_A1       ( PinMod1<<2 )   //External memory address line 1
/*PORT4 pin2*/
 #define P4_2_G        ( PinMod0<<4 )   //General purpose digital in/out pin
 #define P4_2_A2       ( PinMod1<<4 )   //External memory address line 2
/*PORT4 pin3*/
 #define P4_3_G        ( PinMod0<<6 )   //General purpose digital in/out pin
 #define P4_3_A3       ( PinMod1<<6 )   //External memory address line 3
/*PORT4 pin4*/
 #define P4_4_G        ( PinMod0<<8 )   //General purpose digital in/out pin
 #define P4_4_A4       ( PinMod1<<8 )   //External memory address line 4
/*PORT4 pin5*/
 #define P4_5_G        ( PinMod0<<10)   //General purpose digital in/out pin
 #define P4_5_A5       ( PinMod1<<10)   //External memory address line 5
/*PORT4 pin6*/
 #define P4_6_G        ( PinMod0<<12)   //General purpose digital in/out pin
 #define P4_6_A6       ( PinMod1<<12)   //External memory address line 6
/*PORT4 pin7*/
 #define P4_7_G        ( PinMod0<<14)   //General purpose digital in/out pin
 #define P4_7_A7       ( PinMod1<<14)   //External memory address line 7
/*PORT4 pin8*/
 #define P4_8_G        ( PinMod0<<16)   //General purpose digital in/out pin
 #define P4_8_A8       ( PinMod1<<16)   //External memory address line 8
/*PORT4 pin9*/
 #define P4_9_G        ( PinMod0<<18)   //General purpose digital in/out pin
 #define P4_9_A9       ( PinMod1<<18)   //External memory address line 9
/*PORT4 pin10*/
 #define P4_10_G       ( PinMod0<<20)   //General purpose digital in/out pin
 #define P4_10_A10     ( PinMod1<<20)   //External memory address line 10
/*PORT4 pin11*/
 #define P4_11_G       ( PinMod0<<22)   //General purpose digital in/out pin
 #define P4_11_A11     ( PinMod1<<22)   //External memory address line 11
/*PORT4 pin12*/
 #define P4_12_G       ( PinMod0<<24)   //General purpose digital in/out pin
 #define P4_12_A12     ( PinMod1<<24)   //External memory address line 12
/*PORT4 pin13*/
 #define P4_13_G       ( PinMod0<<26)   //General purpose digital in/out pin
 #define P4_13_A13     ( PinMod1<<26)   //External memory address line 13
/*PORT4 pin14*/
 #define P4_14_G       ( PinMod0<<28)   //General purpose digital in/out pin
 #define P4_14_A14     ( PinMod1<<28)   //External memory address line 14
/*PORT4 pin15*/
 #define P4_15_G       ( PinMod0<<30)   //General purpose digital in/out pin
 #define P4_15_A15     ( PinMod1<<30)   //External memory address line 15
/*PORT4 pin24*/
 #define P4_24_G       ( PinMod0<<16)   //General purpose digital in/out pin
 #define P4_24_OE      ( PinMod1<<16)   //LOW active Output Enable signal
/*PORT4 pin25*/
 #define P4_25_G       ( PinMod0<<18)   //General purpose digital in/out pin
 #define P4_25_BLS0    ( PinMod1<<18)   //LOW active Byte Lane select signal 0
/*PORT4 pin28*/
 #define P4_28_G       ( PinMod0<<24)   //General purpose digital in/out pin
 #define P4_28_MAT2_0  ( PinMod1<<24)   //Match out for TIMER2 channel0
 #define P4_28_TXD3    ( PinMod2<<24)   //TxD for UART3
/*PORT4 pin29*/
 #define P4_29_G       ( PinMod0<<26)   //General purpose digital in/out pin
 #define P4_29_MAT2_1  ( PinMod1<<26)   //Match out for TIMER2 channel1
 #define P4_29_RXD3    ( PinMod2<<26)   //RxD for UART3
/*PORT4 pin30*/
 #define P4_30_G       ( PinMod0<<28)   //General purpose digital in/out pin
 #define P4_30_CS0     ( PinMod1<<28)   //LOW active Chip Select 0 signal
/*PORT4 pin31*/
 #define P4_31_G       ( PinMod0<<30)   //General purpose digital in/out pin
 #define P4_31_CS1     ( PinMod1<<30)   //LOW active Chip Select 1 signal
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/





#endif
